package com.bestcem.xm.user.enums;

import com.bestcem.xm.common.core.enums.CommonErrorEnum;
import com.bestcem.xm.common.core.enums.ReqErrorCodeEnum;
import com.bestcem.xm.common.core.enums.ResourceErrorCodeEnum;
import lombok.Getter;
import lombok.ToString;

/**
 * 错误信息提示常量枚举
 *
 * @author wangyunyun <yunyun.wang@idiaoyan.com>
 * @version v1.0
 * @date 2022/5/27 16:00
 */
@Getter
@ToString
public enum UserErrorMsgEnum {

    /**
     * 开放平台-同步层级-异常
     */
    OPEN_API_PARAM_LOST(ReqErrorCodeEnum.PARAM_LOST, "参数缺失"),
    OPEN_API_PARAM_FORMAT(ReqErrorCodeEnum.PARAM_FORMAT, "参数格式错误"),
    OPEN_API_LEVEL_NAME_REPECT(ReqErrorCodeEnum.PARAM_FORMAT, "group_level_list[name={0}] cannot be repeated"),
    OPEN_API_LEVEL_NAME_FORMAT(ReqErrorCodeEnum.PARAM_FORMAT, "group_level_list[name = {0}] 含有非法字符"),
    OPEN_API_LEVEL_NUM_REPECT(ReqErrorCodeEnum.PARAM_FORMAT, "group_level_list[level={0}] cannot be repeated"),
    OPEN_API_GROUP_CODE_REPECT(ReqErrorCodeEnum.PARAM_FORMAT, "group_list[code={0}] cannot be repeated"),
    OPEN_API_GROUP_ROOT_EXCEED(ReqErrorCodeEnum.PARAM_FORMAT, "不能同时有两个根节点"),
    OPEN_API_GROUP_PARENT_NOT_NULL(ReqErrorCodeEnum.PARAM_FORMAT, "根节点的parent_code应为空"),
    OPEN_API_GROUP_ROOT_LEVEL_WRONG(ReqErrorCodeEnum.PARAM_FORMAT, "group_list[code = {0}] 根节点的所属层级应该为第一层层级group_level_list[name = {1}]"),
    OPEN_API_GROUP_PARENT_NULL(ReqErrorCodeEnum.PARAM_LOST, "非根节点的parent_code不能为空"),
    OPEN_API_GROUP_PARENT_NOT_FOUND(ReqErrorCodeEnum.PARAM_FORMAT, "group_list[parent_code = {0}] 上一级未找到"),
    OPEN_API_GROUP_RELATION_NEST(ReqErrorCodeEnum.PARAM_FORMAT, "group_list[code = {0}] 层级关系有循环嵌套"),
    OPEN_API_GROUP_LEVEL_NOT_FOUND(ReqErrorCodeEnum.PARAM_FORMAT, "group_list[level_name ={0}] is not found in group_level_list[name]"),
    OPEN_API_GROUP_ADMIN_NOT_FOUND(ResourceErrorCodeEnum.NOT_FOUND, "group_list[admin_name = {0}] 通过组织负责人账号未查询到已激活的用户"),
    ;

    private final CommonErrorEnum commonErrorEnum;

    private final String msg;

    UserErrorMsgEnum(CommonErrorEnum commonErrorEnum, String msg) {
        this.commonErrorEnum = commonErrorEnum;
        this.msg = msg;
    }
}
